local jizhu = fk.CreateSkill({
  name = "mini_mou__jizhu",
  tags = { Skill.Wake },
})

Fk:loadTranslationTable{
  ["mini_mou__jizhu"] = "积著",
  [":mini_mou__jizhu"] = "觉醒技，结束阶段，若你本回合造成过至少2点伤害，或本局游戏有其他角色进入过濒死状态，你将〖龙胆〗升至二级。",

  ["$mini_mou__jizhu1"] = "以八尺之躯，殉国家之急！ ",
  ["$mini_mou__jizhu2"] = "天下犹未平，自当报国恩！",
  ["$mini_mou__jizhu3"] = "汉室中兴，指日可待！",
}

jizhu:addEffect(fk.EventPhaseStart, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jizhu.name) and
      player.phase == Player.Finish and
      player:usedSkillTimes(jizhu.name, Player.HistoryGame) == 0
  end,
  can_wake = function(self, event, target, player, data)
    if #player.room.logic:getEventsOfScope(GameEvent.Dying, 1, function (e)
      return e.data.who ~= player
    end, Player.HistoryGame) > 0 then
      return true
    else
      local n = 0
      player.room.logic:getActualDamageEvents(1, function(e)
        local damage = e.data
        if damage.from == player then
          n = n + damage.damage
        end
      end, Player.HistoryTurn)
      return n > 1
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:setPlayerMark(player, jizhu.name, 1)
  end,
})

return jizhu
